Skip to content

Conversation

@shsms
Copy link
Contributor

@shsms shsms commented May 9, 2025

Closes #1130

Copilot AI review requested due to automatic review settings May 9, 2025 10:30
@shsms shsms requested a review from a team as a code owner May 9, 2025 10:30
@shsms shsms requested review from Marenz and removed request for a team May 9, 2025 10:30
@github-actions github-actions bot added part:docs Affects the documentation part:data-pipeline Affects the data pipeline labels May 9, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables the creation of PVPool instances even in locations without any PV installations.

  • Conditionally initializes the bounds_tracker attribute based on the presence of component_ids
  • Adds a check in the stop method to safely await the stop of bounds_tracker only when it has been instantiated

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/frequenz/sdk/timeseries/pv_pool/_pv_pool_reference_store.py Conditionally initialize and stop the bounds_tracker based on component_ids
RELEASE_NOTES.md Added note regarding creation of PV Pool instances without PV

self.bounds_channel.new_sender(),
)
self.bounds_tracker.start()

Copy link

Copilot AI May 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding an inline comment to explain why bounds_tracker is initialized to None and conditionally set based on component_ids. This will help maintainers understand the intent behind this change.

Suggested change
# Initialize bounds_tracker to None. It will be conditionally assigned
# if component_ids are provided or derived, as it is only needed to track
# system bounds for the specified components.

Copilot uses AI. Check for mistakes.
shsms added 2 commits May 9, 2025 12:39
Without this, it was hard to create `PVPool`s at locations without PV.

Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
@shsms shsms force-pushed the pv-pool-ohne-pv branch from 26ef7bb to 5f4d157 Compare May 9, 2025 10:39
Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as this, if it is really an issue, it is not introduced by this PR.

Comment on lines +114 to +115
if self.bounds_tracker is not None:
await self.bounds_tracker.stop()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not introduced by this PR, but just FYI, as I mentioned in other insteances and at least if this is a BackgroundService, stopping of sub-services should be done separately via cancel() and wait(), and leave stop() being just an alias for self.cancel(); await self.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a bug the way it is now, at least not in this layer, because this is in the *reference_store, which is supposed to be shared already.

But we will have to look at the outer layers, where we just removed the call to *reference_store.stop() as a temporary fix.

@github-project-automation github-project-automation bot moved this from To do to Review approved in Python SDK Roadmap May 12, 2025
@shsms shsms added this pull request to the merge queue May 12, 2025
Merged via the queue into frequenz-floss:v1.x.x with commit 5100594 May 12, 2025
5 checks passed
@shsms shsms deleted the pv-pool-ohne-pv branch May 12, 2025 09:12
@github-project-automation github-project-automation bot moved this from Review approved to Done in Python SDK Roadmap May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:data-pipeline Affects the data pipeline part:docs Affects the documentation

Projects

Development

Successfully merging this pull request may close these issues.

Using PV pool in locations without PV cause error

2 participants